import { mapState, mapMutations } from "vuex";
export const systemMixins = {
  computed: {
    ...mapState("system", ["safeTop"]),
  },
};

export const userMixins = {
  computed: {
    ...mapState("user", ["profile"]),
  },
  methods: {
    ...mapMutations("user", ["setProfile", "clearProfile"]),
  },
};

export const getDataMixin = (key, serve) => ({
  data() {
    return {
      [key]: [],
    };
  },
  onShow() {
    const { result } = serve();
    this[key] = result;
  },
});
